Home:ALL Converter>How to convert string to const char[] in c++

How to convert string to const char[] in c++

Ask Time:2021-07-12T03:22:51         Author:Coder436

Json Formatter

I am working on a C++ project for a Vex Robot, I am using a function that takes a const char[] but for showing an integer, there is no such function that converts to const char[], so is there a way to do that. All the search results showed how to convert to const char* and by the way "string" is of type const char[].

EDIT: I also need to covert the string to concatenate tow strings (but ended up just coverting both strings to std::string and then back to const char[])

Author:Coder436,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/68339345/how-to-convert-string-to-const-char-in-c
yy